---
redirect_from:
  - /config/downstream/bubble
---

# Bubble

[Bubble](https://bubble.io/) is one of the oldest and most comprehensive
low-code app-building platforms on the market.

Here's a short video guide on how to connect Bubble to Cube.

<LoomVideo url="https://www.loom.com/embed/554bee2daa7e42529b8eb4d0494e6674" />

## Connect from Cube Cloud

Navigate to the [Integrations](/product/workspace/integrations#connect-specific-tools)
page, click <Btn>Connect to Cube</Btn>, and choose <Btn>Bubble</Btn> to get
detailed instructions.

## Connect from Cube Core

You can connect a Cube deployment to Bubble using the [REST API](/reference/rest-api).

For a Cube instance publicly available at a specific `HOST`, the REST API URL
would be `HOST/cubejs-api/v1`. Please refer to the
[REST API page](/reference/rest-api) for details.

You will also need to generate a JSON Web Token that would be used to
authenticate requests to Cube.

Please check the [Security page](/product/auth#generating-json-web-tokens-jwt)
to learn how to generate a token. We suggest generating a long-lived JWT that
won't expire soon.

## Connecting from Bubble

### Add an API connector plugin

Navigate to the plugins. Select and install the API connector plugin.

### Create a new API

Click "Add another API".

<Screenshot src="https://ucarecdn.com/a2e85b6e-b321-40d8-ba56-2dc4b7d7f50b/" />

Next, set the "Authentication" as "Private key in header", and copy and paste
Cube's Authorization token. Additionally, make sure to add a shared header for
all calls by setting `content-type` to `application/json`.

<Screenshot src="https://ucarecdn.com/8bf3d936-1886-4bc0-b6c4-10bb76adb21f/" />

### Create a POST request

Click "Add another call".

Copy and paste the Cube REST API, including the `/load` path, in the API field.
Make sure to select "Use as: Action", and use the `JSON` "data type" and "body
type".

<Screenshot src="https://ucarecdn.com/5f857c2f-ba88-40a9-9112-b4368a19b608/" />

Get your Cube query in the JSON
[query format](/product/apis-integrations/rest-api/query-format) ready. You can
copy it from Cube’s Playground or compose manually.

Paste the JSON query in the **Body**. Make sure to add a `query` parameter for
your JSON query.

<Screenshot src="https://ucarecdn.com/4e86bc38-56bb-44bc-b99d-6b55bb963761/" />

Next, hit "Initialize / Reinitialize call".

### Create a workflow

First, add a "Page is loaded" event. Add an action that uses the API connector
plugin. Next, add another action to set the state of an element. Select the
index element, and create a new custom state. In this example I named the custom
state `OrdersByMonth` and selected the `data` field of the API response. Make
sure to toggle the "This state is a list" checkbox as well. While setting the
state's value you will need to select "Result of step 1" and the `data` field.

<Screenshot src="https://ucarecdn.com/9f7a98e2-6ba8-463b-bbee-059fd29da4ab/" />

### Display the data

Bubble has an amazing feature where you can drag and drop UI components into the
design dashboard.

Once you added a chart, you configure the data points. More specifically, the
series categories and series data. For the series categories and series data you
need to select the `index` and `OrdersByMonth` state followed by the data point
you want to use in order to populate the chart.

<Screenshot src="https://ucarecdn.com/c2684ea0-5cad-4fee-9496-e9bc745ea68c/" />

Once you open the "Preview" you'll see your nicely rendered charts.

<Screenshot src="https://ucarecdn.com/1e1790fc-a5ed-4921-b1f1-7cd326ea6932/" />
